﻿using System.Collections.Generic;

namespace MicroDb.Generate
{
    public class EnumItem : BaseObj
    {
        public int? Value { get; set; }
        public string Color { get; set; }
        public string Description { get; set; }

        public string[] GetAttributes()
        {
            List<string> attrs = new List<string>();
            if (!string.IsNullOrEmpty(Description))
            {
                attrs.Add($"System.ComponentModel.Description(\"{Description}\")");
            }
            if (!string.IsNullOrEmpty(Color))
            {
                attrs.Add($"System.Color(\"{Color}\")");
            }
            return attrs.ToArray();
        }

        public override string[] Attributes { get => GetAttributes(); set => base.Attributes = value; }

    }
    public class EnumObj : BaseObj
    {
        public List<EnumItem> Items { get; set; }

    }
}